How to remove child class from active div?
How to remove child class from active div?
544
31-Jul-2023
Updated on 01-Aug-2023
Aryan Kumar
01-Aug-2023Sure, here is how to remove a child class from an active div:
Using JavaScript
The following JavaScript code will remove the
activeclass from thedivelement with the idmyDiv:JavaScript
This code will first get the
divelement with the idmyDiv. Then, it will call theclassList.remove()method to remove theactiveclass from thedivelement.Here is an example of how to use this code:
HTML
This code will create a
divelement with the idmyDiv. Thedivelement will have theactiveclass. When the user clicks on thedivelement, theactiveclass will be removed from thedivelement.